/*


 */

package manualTest;

import jas.bank.BankClient;
import jas.bank.BankServer;
import jas.rpc.RemoteException;
import java.io.IOException;

/**
 *
 *
 */
public class JarRunner {
    
    public static void main(String[] args) throws RemoteException, IOException {
        if (args.length > 0) {
            if(args[0].equalsIgnoreCase("-Server")) {
                if (args.length == 2) BankServer.main(new String[]{args[1]});
                else BankServer.main(new String[]{});
                
            } else if(args[0].equalsIgnoreCase("-Stress")) {
                BankClient.main(new String[]{args[1],args[2]});
                
            } else if(args[0].equalsIgnoreCase("-Client")) {
                jas.bank.Client.main(new String[]{args[1],args[2]});
                
            } else if(args[0].equalsIgnoreCase("-Cluster")) {
                jas.bank.ServerCluster.main(new String[0]);
                
            } else {
                showUsage();
            }
            
        } else {
            showUsage();
        }
    }
    
    private static void showUsage() {
        System.out.println("Usage:");
        System.out.println("\t-Server -log?");
        System.out.println("\t-Client host port");
        System.out.println("\t-Stress host port");
        
    }

}
